//
//  RYCImagePageView.h
//  Locoso
//
//  Created by zhiwei ma on 12-10-23.
//  Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
//

#import <UIKit/UIKit.h>

@class RYCImagePageView;
@protocol RYCImagePageViewDelegate <NSObject>
@optional
- (void)didTapAtPage:(RYCImagePageView*)aPageView pageIndex:(NSInteger)aPage;
@end

typedef enum
{
    RYCPageViewScrollType_Swing = 0,
    RYCPageViewScrollType_Loop
}RYCPageViewScrollType;

typedef enum
{
    RYCPageViewState_Stop = 0,
    RYCPageViewState_Start,
    RYCPageViewState_Pause
}RYCPageViewState;

@interface RYCImagePageView : UIView
<UIScrollViewDelegate>
{
    id<RYCImagePageViewDelegate> _delegate;
    NSArray* imageViews;
    UIScrollView* _scrollView;
    UIPageControl* _pageControl;
    NSTimer* _timer;
    RYCPageViewState _state;
    NSInteger _scrollDirection;//RYCPageViewScrollType_Swing时有效
}

@property (nonatomic, readonly) NSInteger currentPage;//当前页索引
@property (nonatomic) RYCPageViewScrollType scrollType;

@property (nonatomic, copy) NSArray* imageViews;//UIImageView*
@property (nonatomic) NSTimeInterval timeInterval;//自动滚动周期

- (id)initWithFrame:(CGRect)frame scrollType:(RYCPageViewScrollType)aType delegate:(id)aDelegate;

- (void)setPageControlBgColor:(UIColor*)aColor;

- (void)startAutoScroll;
- (void)pauseAutoScroll;
- (void)stopAutoScroll;
- (void)stopAndClearDelegate;
@end
